var ws,orderId,cur_page = 1;
var reponse = [];
var app = angular.module("app",[]);
app.controller("my_controller",function($scope,$http){
	$scope.initView = function(){
		plus.nativeUI.showWaiting('加载中...');
		$http({
			method:"post",
			url:apiRoot,
			data:{
				action:"Orderid.getGoodsContent",
				id:orderId,			
				page:cur_page
			}
		}).then(function successFunction(result){
			plus.nativeUI.closeWaiting();
//			reponse.push()
			$scope.res = result.data.data;
			$scope.imgs = result.data.data[0].img;
			console.log(JSON.stringify($scope.res));  
		},function errorFunction(e){
			plus.nativeUI.closeWaiting(); 
			console.log(e);
		})
	}
})



document.addEventListener('plusready',function(){
	ws = plus.webview.currentWebview();
	orderId = ws.order_id;
	appElement = document.querySelector("[ng-controller=my_controller]");
	$scope= angular.element(appElement).scope();
	$scope.initView();
	$scope.$apply();
},false)